import java.util.Scanner;

public class D881 {
	public static int summation(int d) {
		int sum = 1;
		int curD = 1;
		int preNum = 1;
		int curNum;
				
		for(int i = 1; i < 50; i++) {
			curNum = (preNum + curD);
			sum += curNum;
			
			preNum = curNum;
			curD = ((d * i) + 1);
		}
				
		return sum;
	}
	public static void main(String args[]) {
		Scanner sc =new Scanner(System.in);
		
		while(sc.hasNext()) {
			int d = Integer.parseInt(sc.nextLine());

			System.out.println(Integer.toString(summation(d)));
		}
	}
}